local skel=fk.CreateSkill{
    name="steam__cengxue",
}

Fk:loadTranslationTable{
    ["steam__cengxue"] = "层削",
    [":steam__cengxue"] = [[出牌阶段限一次，你可随机获得任意名手牌数之和小于你的角色各一张牌，
    然后这些角色需选择一项：1.发动“举义”，并视为对你使用一张【杀】；2.发动“层削”。]],
    ["#steam__cengxue"] = [[出牌阶段限一次，你可随机获得任意名手牌数之和小于你的角色各一张牌，]],
    ["steam__cengxue1"] = "发动“举义”，并视为对你使用一张【杀】",
    ["steam__cengxue2"] = "发动“层削”",
    
}


skel:addEffect("active", {
    prompt="#steam__cengxue",
    card_num=0,
    card_filter=Util.FalseFunc,
    target_filter = function(self, player, to_select, selected)
        local total=0
        if #selected==0 then return to_select:getHandcardNum()<player:getHandcardNum() end
        for _,p in ipairs(selected) do
            total=total+p:getHandcardNum()
        end
        return total<player:getHandcardNum()
      end,
    on_use =function(self, room, effect)
        local player=effect.from
        local room=player.room
        for _,p in ipairs(effect.tos) do
            local cards = p:getCardIds("he")
            if #cards>0 then
                room:moveCardTo(table.random(cards,1),Card.PlayerHand,player,fk.ReasonPrey,skel.name)
            end
        end
        for _,p in ipairs(effect.tos) do
            local invoke=room:askToChoice(p, {choices={"steam__cengxue1","steam__cengxue2"},
            prompt="层削：你可以发动“举义”，并视为对中行寅使用一张【杀】/发动“层削”。",skill_name=skel.name })
            if invoke=="steam__cengxue1" then
                local skill=Fk.skills["steam__juyi"]---@type TriggerSkill
                if skill:isInstanceOf(TriggerSkill) then
                    skill:use(nil, p, p, nil)
                end
                room:useVirtualCard("slash",nil,p,player,skel.name)
            elseif invoke=="steam__cengxue2" then
                room:askToUseActiveSkill(p,{
                    skill_name="steam__cengxue",
                })
            end
        end
    end,

})



return skel